package com.gongzhiyun.springboot3test.mapper.novel;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gongzhiyun.springboot3test.entity.novel.NovelCommentPraises;
import com.gongzhiyun.springboot3test.entity.novel.NovelCommentReplyPraises;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface NovelCommentReplyPraisesMapper extends BaseMapper<NovelCommentReplyPraises> {
    //查询某回复的点赞量
    @Select("select count(*) from novel_comment_reply_praises where comment_reply_id=#{id}")
    Integer getReplyPraiseCount(Integer id);


    //查询某评论是否被当前用户点赞
    @Select("select  * from novel_comment_reply_praises where user_id=#{userId} and comment_reply_id=#{commentId}")
    NovelCommentReplyPraises isPraised(Integer userId, Integer commentId);

}
